<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>storage</title>
</head>
<body>


<script>
   
window.onload = function(){


    myAddEvent(window, "storage", function(ev){
        console.log(ev);
        console.log(ev.key);
        console.log(ev.newValue);
        console.log(ev.oldValue);
        console.log(ev.storageArea);
        console.log(ev.url);
    })
}



function myAddEvent(obj, ev, fn){
    if(obj.attachEvent){
        obj.attachEvent('on'+ev, fn);
    }
    else{
        obj.addEventListener(ev, fn, false)
    }
}

</script>
</body>
</html>